#include <iostream>
using namespace std;

class Test{
    private:
        int a;
        int b;
    public:
        // 对于成员函数 相当于有一个隐藏形参 this
        // void init(int x, int y, Test * const this){
        // 哪个类对象调成员函数 this 就指向谁
        void init(int x, int y){
            cout << "init : this = " << this << endl;
            #if 0
            a = x;
            b = y;
            #else
            // 上面的写法 本质是
            this->a = x;
            this->b = y;
            #endif
        }
        void show(){
            cout << this << " " << a << " " << b << endl;
        }
};

int main(int argc, const char *argv[]){
    Test t1;
    cout << "main : &t1 = " << &t1 << endl;
    t1.init(10, 20);
    t1.show();

    Test t2;
    cout << "main : &t2 = " << &t2 << endl;
    t2.init(30, 40);
    t2.show();

    return 0;
}